< previous page page_980 next page >

Page 980
INSERT INTO Customers Values('SMITHJ', 'John Smith', 'INDV',
     '160 Main Street', 'Dublin', 'Ohio', '45621',
     '614-569-8975', '614-569-5580');
INSERT INTO Customers Values('JONEST', 'Jones Taxi', 'BUS',
     '421 Shoe St.', 'Milford', 'Rhode Island', '03215',
     '401-737-4528', '401-667-8900');
INSERT INTO Customers Values('JACKSONT', 'Thomas Jackson', 'INDV',
     '123 Walnut Street', 'Oxford', 'Maine', '05896',
     '546-897-8596', '546-897-8500');
// Copy data into the localities table
SELECT CustomerID, City, State INTO Localities FROM Customers;
// Display the results
SELECT * FROM CustomerType;
SELECT * FROM Customers;
SELECT * FROM Localities;
3. You would issue the following SQL statement to delete the SMITHJ record from the Customers table:
DELETE FROM Customers WHERE CustomerID = 'SMITHJ';
You would use the DROP TABLE command to delete an entire table. To delete the Customers table, you would issue the following statement:
DROP TABLE Customers;
Day 16
Answers to Day 16 Quiz
1. It is not necessarily a good idea to look at database optimization strictly from the point of view of processing performance. Other factors such as data integrity are also important. The role of data normalization is to strike a balance between speed and integrity.
2. If the term ''First Normal Form" is applied to a database, it means that the first rule of data normalizationeliminate repeating groupshas been achieved.
3. The first rule of data normalization is to delete repeating groups, whereas the second rule of normalization requires the deletion of redundant data. Rule one requires the separation of fields that contain multiple occurrences of similar data into separate tables. Rule two requires that fields that must maintain constant relationships with other fields (for example, the name of a customer as associated with the customer ID) should be placed in a separate table.
4. Do not include calculated fields in a data table. Not only does the calculated data take up disk space, but problems can arise if one of the fields used in the calculation is deleted or changed. Calculations are best saved for forms and reports. Placing a calculated field in your data table violates the third rule of data normalizationeliminate columns not dependent on keys.

 
< previous page page_980 next page >

If you like this book, buy it!